package com.revai.engine.basic.core;

import java.util.List;
import java.util.Map;

/**
 * 字段定义表
 */
public class TableField {
    /**
     * 字段key
     */
    private String key;
    /**
     * 字段名称
     */
    private String name;
    /**
     * 字段类型
     */
    private String type;
    /**
     * 是否可编辑
     */
    private Boolean editable;
    /**
     * 是否必填
     */
    private Boolean require;
    /**
     * 是否显示
     */
    private Boolean display;
    /**
     * 默认值
     */
    private String defaultValue;
    /**
     * 枚举值
     */
    private List values;
    /**
     * 枚举数据源
     */
    private Object source;
    /**
     * 是否批量上传
     */
    private Boolean batch_upload;
    /**
     * 范围值
     */
    private List range;
    /**
     * hint提示
     */
    private String hint;
    /**
     * textarea行数
     */
    private Integer rows;
    /**
     * autocomplete配置
     */
    private Map autocomplete;

    public TableField(Map map) {
        if (map != null) {
            this.setKey((String) map.get("key"));
            this.setName((String) map.get("name"));
            this.setType((String) map.get("type"));
            this.setEditable((Boolean) map.get("editable"));
            this.setRequire((Boolean) map.get("require"));
            this.setDisplay((Boolean) map.get("display"));
            this.setDefaultValue((String) map.get("defaultValue"));
            this.setValues((List) map.get("values"));
            this.setSource(map.get("source"));
            this.setBatch_upload((Boolean) map.get("batch_upload"));
            this.setRange((List) map.get("range"));
            this.setHint((String) map.get("hint"));
            this.setRows((Integer) map.get("rows"));
            this.setAutocomplete((Map) map.get("autocomplete"));
        }
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Boolean getEditable() {
        return editable;
    }

    public void setEditable(Boolean editable) {
        this.editable = editable;
    }

    public Boolean getRequire() {
        return require;
    }

    public void setRequire(Boolean require) {
        this.require = require;
    }

    public Boolean getDisplay() {
        return display;
    }

    public void setDisplay(Boolean display) {
        this.display = display;
    }

    public String getDefaultValue() {
        return defaultValue;
    }

    public void setDefaultValue(String defaultValue) {
        this.defaultValue = defaultValue;
    }

    public List getValues() {
        return values;
    }

    public void setValues(List values) {
        this.values = values;
    }

    public Object getSource() {
        return source;
    }

    public void setSource(Object source) {
        this.source = source;
    }

    public Boolean getBatch_upload() {
        return batch_upload;
    }

    public void setBatch_upload(Boolean batch_upload) {
        this.batch_upload = batch_upload;
    }

    public List getRange() {
        return range;
    }

    public void setRange(List range) {
        this.range = range;
    }

    public String getHint() {
        return hint;
    }

    public void setHint(String hint) {
        this.hint = hint;
    }

    public Integer getRows() {
        return rows;
    }

    public void setRows(Integer rows) {
        this.rows = rows;
    }

    public Map getAutocomplete() {
        return autocomplete;
    }

    public void setAutocomplete(Map autocomplete) {
        this.autocomplete = autocomplete;
    }
    
}
